package DayThree;

import java.util.Arrays;
import java.util.Scanner;

public class TestOne {
    public static int[] guiBing(int[] arr,int left,int right){
        if(left==right){
            return new int[]{arr[left]};
        }
        int mid = left+(right-left)/2;
        int[] leftArr = guiBing(arr,left,mid);
        int[] rightArr = guiBing(arr,mid+1,right);
        arr = heBing(leftArr,rightArr);
        return arr;
    }

    private static int[] heBing(int[] leftArr, int[] rightArr) {
        int n = 0;
        int m = 0;
        int k = 0;
        int[] tmp = new int[leftArr.length+ rightArr.length];
        while(n<leftArr.length&&m<rightArr.length){
            if(leftArr[n]<rightArr[m]){
                tmp[k] = leftArr[n];
                k++;
                n++;
            }else{
               tmp[k] = rightArr[m];
               k++;
               m++;
            }
        }
        if(n< leftArr.length) {
            while (n < leftArr.length) {
                tmp[k] = leftArr[n];
                k++;
                n++;
            }
        }else{
                while(m<rightArr.length){
                    tmp[k] = rightArr[m];
                    m++;
                    k++;
                }
            }
        return tmp;
        }


    public static int deal(String str){
           boolean flag = false;
           int count = 0;
           int[] arr = new int[str.length()];
           int j = 0;
           for(int i =0;i<str.length();i++){
               if(!Character.isDigit(str.charAt(i))){
                  arr[j] = count;
                  j++;
                  count=0;
                  continue;

               }else{
                   count++;
               }
           }
           arr[j] = count;
        arr = guiBing(arr,0,arr.length-1);
           return arr[arr.length-1];
     }

    public static void main3(String[] args) {
             int[] arr = new int[]{9,6,4,7,3,1};
            arr= guiBing(arr,0, arr.length-1);
        System.out.println(Arrays.toString(arr));

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String str = sc.nextLine();
            int outCome = deal(str);
            System.out.println(outCome);
        }
    }
}
